<template>
  <div>
    <div class="header">
      <div class="left">
        <span>关注</span>
        <span>推荐</span>
      </div>
      <div class="right">
        <van-icon name="add-o"/>
      </div>
    </div>
    <Search></Search>
    <div>
      <van-swipe :autoplay="3000" class="my-swipe">
        <van-swipe-item v-for="(image, index) in images" :key="index">
          <img :src="image">
        </van-swipe-item>
      </van-swipe>
    </div>
    <div class="middle">
        <ul>
          <li><div class="img"><img src="../images/图片.png" alt=""></div><p>每日专辑</p></li>
          <li><div class="img"><img src="../images/星球.png" alt=""></div><p>热门</p></li>
          <li><div class="img"><img src="../images/热门.png" alt=""></div><p>好看</p></li>
          <li><div class="img"><img src="../images/眼睛.png" alt=""></div><p>圈子</p></li>
          <li><div class="img"><img src="../images/风车.png" alt=""></div><p>活动</p></li>
        </ul>
    </div>
  </div>
</template>

<script>
import Search from "../components/search";
import api from '../api/index'
export default {
  components: {
    Search
  },
  data() {
    return {
      images: [
        "https://s3.bmp.ovh/imgs/2021/11/53dfa9094383b46e.png",
        "https://s3.bmp.ovh/imgs/2021/11/9226980877a139b9.png",
        "https://s3.bmp.ovh/imgs/2021/11/4004b51bf3b1123d.png",
        "https://s3.bmp.ovh/imgs/2021/11/a9cf9428feea5f9b.png"
        
      ]
    };
  },
  beforeMount(){
   let tt= api.querySwiper();
   console.log(tt)
  }
};
</script>

<style lang="less" scoped>
.header {
  font-size: 14px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .left {
    margin-left: 30px;
  }
  .left span:nth-child(1) {
    margin-right: 20px;
  }
  .left span:nth-child(2) {
    font-size: 22px;
    font-weight: 700;
  }
  .right {
    margin-right: 30px;
    font-size: 25px;
    color: #ff7575;
  }
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  height: 150px;
  text-align: center;
  img {
    display: block;
    width: 100%;
    height: 100%;
   
  }
}
.middle{
  height: 50px;
  font-size: 14px;
  margin: 20px auto 0px;
  text-align: center;
  ul{
    height: 50px;
    width: 90%;
    margin: 0 auto;
    li{
      width: 20%;
      display: inline-block;
      .img{
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin: 0 auto;
        border: 1px solid red;
        img{
          box-sizing: border-box;
          width: 100%;
        height: 100%;
        padding: 10px;
        }
      }
    }
  }
    
}
</style>